package com.hnucm.c202001020214;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.os.Bundle;

import com.gyf.immersionbar.ImmersionBar;
import com.hnucm.c202001020214.object.Book;

import java.util.ArrayList;
import java.util.List;

public class Others extends BaseActivity {

    public List<Book> bookList = new ArrayList<>();
    RecyclerView recyclerView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_others);

        ImmersionBar.with(this)
                // .statusBarColor(R.color.touming)
                .init();

        recyclerView =findViewById(R.id.recyclerview);
        LinearLayoutManager layoutManager = new LinearLayoutManager(Others.this);
        recyclerView.setLayoutManager(layoutManager);

        BookAdapter adapter = new BookAdapter(bookList);
        recyclerView.setAdapter(adapter);
        initOthers();


    }

    public void initOthers(){
        Book book01 = new Book(R.drawable.qita01,"台灯","9.99元");
        bookList.add(book01);
        Book book02 = new Book(R.drawable.qita02,"置物架","22.00元");
        bookList.add(book02);
        Book book03 = new Book(R.drawable.qita03,"鞋架","18.00元");
        bookList.add(book03);
        Book book04 = new Book(R.drawable.qita04,"风扇","16.80元");
        bookList.add(book04);
        Book book05 = new Book(R.drawable.qita05,"散热器","99.00元");
        bookList.add(book05);
        Book book06 = new Book(R.drawable.qita06,"手机支架","9.99元");
        bookList.add(book06);
        Book book7 = new Book(R.drawable.qita07,"84消毒液","5.00元");
        bookList.add(book7);
        Book book08 = new Book(R.drawable.qita08,"书架","7.00元");
        bookList.add(book08);
        Book book09 = new Book(R.drawable.qita09,"电吹风","23.00元");
        bookList.add(book09);
        Book book10 = new Book(R.drawable.qita10,"眼影","35.00元");
        bookList.add(book10);
    }
}